package fun.barryhome.ebean.model;

import io.ebean.annotation.DraftDirty;
import io.ebean.annotation.DraftOnly;
import io.ebean.annotation.DraftReset;
import io.ebean.annotation.Draftable;
import lombok.*;

import javax.persistence.*;
import java.sql.Timestamp;
import java.util.List;

/**
 * Created on 2021/6/6 3:05 下午
 *
 * @author barry
 * Description:
 */
@Draftable
@Builder
@Data
@Entity
@ToString(callSuper = true)
@AllArgsConstructor
@NoArgsConstructor
@Table(name = "customer")
public class Customer extends BaseModel {

    public static final CustomerFinder find = new CustomerFinder();

    private String name;


    @DraftOnly
    Timestamp whenPublish;

    @DraftDirty
    Boolean draft;

    @DraftReset
    String author;

    @OneToMany(cascade = {CascadeType.ALL})
    List<Group> groupList;
}
